Conversation
Patryk-Jastrzebski-Mobica
left a comment
There was a problem hiding this comment.
it's not all there is, but enough for the moment
| CATEGORY ${CATEGORY_NAME} | ||
| AUTHOR "Mobica" | ||
| NAME "sparse_image" | ||
| DESCRIPTION "Sample description" |
There was a problem hiding this comment.
add description
There was a problem hiding this comment.
don't forget to add sample and feature descriptions and Mobica copyright information
shaders/sparse_image/shader.vert
Outdated
| @@ -0,0 +1,18 @@ | |||
| #version 450 | |||
There was a problem hiding this comment.
add Mobica copyright information
shaders/sparse_image/shader.frag
Outdated
| @@ -0,0 +1,44 @@ | |||
| #version 450 | |||
There was a problem hiding this comment.
add Mobica copyright information
| NAME "sparse_image" | ||
| DESCRIPTION "Sample description" | ||
| SHADER_FILES_GLSL | ||
| "shader.vert" |
There was a problem hiding this comment.
use full path sparse_image/shader.vert and rename the shader name e.g. to sparse.vert
| VK_CHECK(vkCreateGraphicsPipelines(get_device().get_handle(), pipeline_cache, 1, &pipeline_create_info, nullptr, &sample_pipeline)); | ||
| } | ||
|
|
||
| void sparse_image::setup_camera() |
There was a problem hiding this comment.
camera should be setup in constructor
|
|
||
| void sparse_image::generate_mips() | ||
| { | ||
| VkCommandBuffer command_buffer = begin_single_time_command(); |
There was a problem hiding this comment.
use device->create_command_buffer();
and end it device->flush_command_buffer();
| alignas(16) glm::mat4 proj; | ||
| }; | ||
|
|
||
| struct SimpleBuffer |
There was a problem hiding this comment.
This structure is not needed and not using it correctly can cause performance problems. Use vkb::core::Buffer, which uses VMA.
| size_t size; | ||
| }; | ||
|
|
||
| struct SimpleVertex |
There was a problem hiding this comment.
Consider using Vertex struct. You can find it in api_vulkan_sample.h
|
|
||
| VK_CHECK(vkAllocateDescriptorSets(get_device().get_handle(), &set_alloc_info, &descriptor_set)); | ||
|
|
||
| VkDescriptorBufferInfo descriptor_buffer_info{}; |
There was a problem hiding this comment.
use this method: create_descriptor()
a5bf9da to
9d48a41
Compare
00b5a16 to
be170d8
Compare
…odel. Instead, whole mesh is calculated using MVP transformation matrix which makes calculations way more trouble-proof. MINOR: some quick changes, using already written wrappers for some functionalities, and adding some descriptions here and there.
…fragment shader - from now the shader checks if the required fragment is resident in the memory before sampling from it (no explicit calculations required,shader will sample from whatever is ACTUALLY available). On the CPU side, workload was divided into stages, many phases removed/rewritten.
* Fixed run-time errors from validation layers * Changed .md to .adoc style
…rame is rendered. * Removed transition_mip_layout() and replaced it with vkb::image_layout_transition(). * Minor bugs and typos.
…ts + allow to toggle color highlighting * Added additional uniform buffer containing data needed by fragment shader * Removed call to bind_sparse_image() from free_unused_memory() as it is redundant * Merged UPDATE_AND_GENERATE and FREE_UNUSED_MEMORY stages * Removed virtual_texture.free_list as it is redundant * Replaced virtual_texture.bind_list with to_be_bound flag under the virtual_texture.page_table * Changed available_memory_index_list from std::list to std::vector * Minor bugs / code refactoring
* Block update is now better prioritized to update the closest areas first * Refactoring
* Memory defragmentation can be enabled for the better memory management
* From now number of vertical/horizontal blocks can be changed from the UI * Number of blocks processed per-frame can be customized from UI too * Frame-counter mechanism can be enabled/disabled from the UI * Moved sparse_queue to separate (if possible) queue family, other than graphics queue * Introduced synchronization between binding the image and submitting the image * update_and_generate() was reduced to single command_buffer and one-time flush() * Several minor reworks/fixes for better code styling and efficiency
* Put additional descriptions to README.adoc * Minor issues, cleanups & typo's
* Minor typos and reworks
0f0b0ad to
cd50971
Compare
cd50971 to
813dce0
Compare
Description
Please include a summary of the change, new sample or fixed issue. Please also include relevant motivation and context.
Please read the contribution guidelines
Fixes #
General Checklist:
Please ensure the following points are checked:
Note: The Samples CI runs a number of checks including:
Sample Checklist
If your PR contains a new or modified sample, these further checks must be carried out in addition to the General Checklist: